This is a non-interactive map built with basic ggplot2 functions. See code here.
I am using a shapefile-based set of multipolygons for the town outlines. These are probably higher resolution than needed. It might be possible to reduce size (and load time) of the dashboard if I switched to the lower resolution geojson-based polygons that I’m using with leaflet.
This is a plotly interactive map created by submitting the previous ggplot2 map to the plotly::ggplotly() function. See code here.
I don’t care for how the tooltips only deploy when the mouse approaches the center of a town/polygon. It should pop up when the mouse is over any part of a town.
I also don’t like the initial scale of the map (too small). Need to see if that’s fixable.
Interactive choropleth via plotly::plot_ly(). See code here
I’m using a geojson-based set of polygons for town outlines in this map. Plot_ly() gets the aspect ratio wrong if using the shapefile-based set of multipolygons that I used with ggplot() and ggplotly() maps. I’m not sure why.
10 Day Average Covid-19 Test Positivity in Connecticut Towns for period ending April 01, 2022
Interactive choropleth via leaflet::leaflet(). See code here.
Previous plots in this series used multipolygon shapes for towns taken from conventional shape files. I couldn’t get that to work with leaflet and so switched to simple polygons. These were read from geojson files, but I think the crucial difference is multipolygon vs. somple polygons.
I don’t know why the colorscale in the legend is inverted. Needs to be fixed.
Leaflet maps don’t provide a “title” feature, as such. Here, I’ve just added the title text above the map. Could use some basic formatting.
Covid data for these figures was compiled by CT Dept. of Public Health through Apr 01, 2022 and accessed through https://data.ct.gov/stories/s/COVID-19-data/wa3g-tfvc/#data-library.
Figures were created by David Braze (davebraze@gmail.com) using R statistical software and released under the Creative Commons v4.0 CC-by license.
All data summaries in this dashboard were produced with the R statistical environment, version 4.1.0. The dashboard itself was made using an Rmarkdown workflow. The following table lists the non-base R packages used in building the dashboard. To see a full citation for a specific package, assuming you have both R and the particular package installed, call (e.g.) citation("dplyr") from the R prompt.
| package | version | date |
|---|---|---|
| dplyr | 1.0.7 | 2021-06-18 |
| FDBpub | 0.0.1 | 2022-01-29 |
| FDButils | 0.0.10 | 2022-01-29 |
| flexdashboard | 0.5.2 | 2020-06-24 |
| forcats | 0.5.1 | 2021-01-27 |
| fs | 1.5.2 | 2021-12-08 |
| ggplot2 | 3.3.5 | 2021-06-25 |
| ggpmisc | 0.4.5 | 2021-12-11 |
| ggpp | 0.4.3 | 2021-12-17 |
| here | 1.0.1 | 2020-12-13 |
| htmltools | 0.5.2 | 2021-08-25 |
| htmlwidgets | 1.5.4 | 2021-09-08 |
| httr | 1.4.2 | 2020-07-20 |
| leaflet | 2.0.4.1 | 2021-01-07 |
| lubridate | 1.8.0 | 2021-10-07 |
| plotly | 4.10.0 | 2021-10-09 |
| purrr | 0.3.4 | 2020-04-17 |
| RCurl | 1.98.1.5 | 2021-09-17 |
| readr | 2.1.1 | 2021-11-30 |
| RSocrata | 1.7.11.2 | 2021-09-14 |
| sf | 1.0.5 | 2021-12-17 |
| stringr | 1.4.0 | 2019-02-10 |
| wordstonumbers | 1.0.1 | 2020-11-13 |
| XML | 3.99.0.8 | 2021-09-17 |